// 函数入口
void main()=> runApp();

// 重载操作
class Vector{
  final int x;
  final int y;

  const Vector(this.x,this.y);

  //重载加号 + (a + b) 
  Vector operator + (Vector v){
    return new Vector(x + v.x, y + v.y);
  }

  // 重载减号 -(a - b)
  Vector operator -(Vector v){
    return new Vector(x - v.x, y - v.y);
  }

  // 重载乘号 *(a * b)
  Vector operator *(Vector v){
    return new Vector(x * v.x, y * v.y);
  }
}

runApp() {
  final v = new Vector(2, 3);
  final w = new Vector(2, 2);

  final r1 = v - w ;
  print('${r1.x} ${r1.y}');

   final r2 = v + w ;
  print('${r2.x} ${r2.y}');

   final r3 = v * w ;
  print('${r3.x} ${r3.y}');
   
}


